package com.ytjj.qmyx.admin.eunm;

public enum  OrderPayTypeEnum {

    //支付方式：pay_delivery货到付款 online_pay在线支付 service客服 score积分

    PAY_DELIVERY("pay_delivery", "货到付款"),
    ONLINE_PAY("online_pay", "在线支付"),
    SERVICE("service", "客服"),
    SCORE("gdt", "积分"),
   ;

    private String code;

    private String name;

    OrderPayTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据枚举code获取名称
     * @param code
     * @return
     */
    public static String getName(String code){
        OrderPayTypeEnum[] list = OrderPayTypeEnum.values();
        for (OrderPayTypeEnum item : list) {
            if (item.getCode().equals(code)) {
                return item.getName();
            }
        }
        return null;
    }
}
